<template>
  <view class="chart-message" @click="onClick">
    <text class="chart-message-title">{{ item.qqdx }}支撑群</text>
    <text class="chart-message-sub">{{ item.cjrmc }}：{{ item.ztnr }}</text>
    <view class="chart-message-avatar">{{ item.cjrmc }}</view>
  </view>
</template>

<script setup>
import { ref, defineProps } from 'vue'
const props = defineProps({
  item: {
    type: Object,
    default: () => ({})
  }
})

const onClick = () => {
  console.log('click', props.item)
}
</script>

<style lang="scss" scoped>
.chart-message {
  width: 100%;
  padding: 8px 0;
  padding-right: 48px;
  position: relative;

  &-title {
    display: block;
    font-weight: 500;
    font-size: 16px;
    color: #333333;
  }

  &-sub {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: #666666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &-avatar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    word-break: keep-all;
    font-size: 13px;
    border-radius: 50%;
    color: #fff;
    background-color: var(--td-brand-color);
  }
}
</style>